<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<form>
			<table border="1">
    		<tr>
        		<td>姓名</td>
        		<td>row 1, cell 2</td>
    		</tr>
    		<tr>
        		<td>row 2, cell 1</td>
       			<td>row 2, cell 2</td>&nbsp;
   			</tr>
			</table>
		</form>
		<input type="button" id="button" value="打印" onclick="fun1()"></input>
	</body>
	<script type="text/javascript">
		//window.onload=fun1();
		function fun1() {
				document.write("<br>");
				for(i = 0; i < 4; i++) {
					for(j = 1; j < 4 - i; j++){
						document.write("&nbsp;&nbsp;");
					}
					for(k = 0; k < (i * 2 + 1); k++){
						document.write("*");
					}
					document.write("<br>");
				}
				for(i = 0; i < 3; i++) {
					for(j = 0; j < i + 1; j++){
						document.write("&nbsp;&nbsp");
					}
					for(k = 0; k < (3 - i) * 2 - 1; k++){
						document.write("*");
					}
					document.write("<br>");
				}
		}
		//fun1();
	</script>
</html>
